package com.aiyige.base.eventbus;

import com.aiyige.page.publish.guarantee.model.GuaranteeItem;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by zhuyakun on 2017/12/6.
 */

public class EventSelectGuarantee {
    public static final int RESULT_OK = 1;
    public static final int RESULT_CANCEL = 2;
    int resultCode;
    List<GuaranteeItem> guaranteeItemList;

    private EventSelectGuarantee(Builder builder) {
        setResultCode(builder.resultCode);
        setGuaranteeItemList(builder.guaranteeItemList);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    public List<GuaranteeItem> getGuaranteeItemList() {
        return guaranteeItemList;
    }

    public void setGuaranteeItemList(List<GuaranteeItem> guaranteeItemList) {
        this.guaranteeItemList = guaranteeItemList;
    }


    public static final class Builder {
        private int resultCode;
        private List<GuaranteeItem> guaranteeItemList;

        private Builder() {
            resultCode = RESULT_CANCEL;
            guaranteeItemList = new LinkedList<>();
        }

        public Builder resultCode(int resultCode) {
            this.resultCode = resultCode;
            return this;
        }

        public Builder guaranteeItemList(List<GuaranteeItem> guaranteeItemList) {
            this.guaranteeItemList = guaranteeItemList;
            return this;
        }

        public EventSelectGuarantee build() {
            return new EventSelectGuarantee(this);
        }
    }
}
